package com.lqq.util;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 返回json格式的统一内容
 * @author liangPC
 *
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class JsonResult {

	/** 业务异常返回编码 */
	public static final int CODE_ERROR = -1;
	/** 业务正常返回编码 */
	public static final int CODE_OK = 0;

	/** 系统是否正常返回标记，正常返回，才取数据对象中的值 */
	private int code = CODE_OK;

	private String msg;

	/**
	 * 返回的数据对象
	 */
	private Object data = null;

	public  static JsonResult buildWithdata(Object data){
		JsonResult jsonResult =	new JsonResult();
		jsonResult.setData(data);
		return jsonResult;
	}
	
}
